Skip to content

Conversation

farzonl
Copy link
Member

@farzonl farzonl commented Sep 8, 2025

fixes #157504

This changes adds the emulation we need for IsNaN, IsNormal, & IsFinite This change only applies these emulations to the llvm.is.fpclass cases of fp16.

Since there is no DX intrinsics yet for these cases, applying the emulation to the necessary intrinsics is left for future implementers of

fixes llvm#157504

This changes adds the emulation we need for IsNaN, IsNormal, & IsFinite
This change only applies these emulations to the llvm.is.fpclass cases
of fp16.

Since there is no DX intrinsics yet for these cases, applying the
emulation to the necessary intrinsics is left for future implementers of
- llvm#99132
- llvm#156069
- llvm#99131
@llvmbot
Copy link
Member

llvmbot commented Sep 8, 2025

@llvm/pr-subscribers-backend-directx

Author: Farzon Lotfi (farzonl)

Changes

fixes #157504

This changes adds the emulation we need for IsNaN, IsNormal, & IsFinite This change only applies these emulations to the llvm.is.fpclass cases of fp16.

Since there is no DX intrinsics yet for these cases, applying the emulation to the necessary intrinsics is left for future implementers of


Full diff: https://github.com/llvm/llvm-project/pull/157505.diff

2 Files Affected:

  • (modified) llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp (+112)
  • (modified) llvm/test/CodeGen/DirectX/is_fpclass.ll (+149-1)
diff --git a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
index c613b351d85b6..b19f4d94a0bb6 100644
--- a/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
+++ b/llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
@@ -86,6 +86,115 @@ static Value *expand16BitIsInf(CallInst *Orig) {
   return B3;
 }
 
+static Value *expand16BitIsNaN(CallInst *Orig) {
+  Module *M = Orig->getModule();
+  if (M->getTargetTriple().getDXILVersion() >= VersionTuple(1, 9))
+    return nullptr;
+
+  Value *Val = Orig->getOperand(0);
+  Type *ValTy = Val->getType();
+  if (!ValTy->getScalarType()->isHalfTy())
+    return nullptr;
+
+  IRBuilder<> Builder(Orig);
+  Type *IType = Type::getInt16Ty(M->getContext());
+
+  Constant *ExpBitMask =
+      ValTy->isVectorTy()
+          ? ConstantVector::getSplat(
+                ElementCount::getFixed(
+                    cast<FixedVectorType>(ValTy)->getNumElements()),
+                ConstantInt::get(IType, 0x7c00))
+          : ConstantInt::get(IType, 0x7c00);
+  Constant *SigBitMask =
+      ValTy->isVectorTy()
+          ? ConstantVector::getSplat(
+                ElementCount::getFixed(
+                    cast<FixedVectorType>(ValTy)->getNumElements()),
+                ConstantInt::get(IType, 0x3ff))
+          : ConstantInt::get(IType, 0x3ff);
+
+  Constant *Zero =
+      ValTy->isVectorTy()
+          ? ConstantVector::getSplat(
+                ElementCount::getFixed(
+                    cast<FixedVectorType>(ValTy)->getNumElements()),
+                ConstantInt::get(IType, 0))
+          : ConstantInt::get(IType, 0);
+
+  Value *IVal = Builder.CreateBitCast(Val, ExpBitMask->getType());
+  Value *Exp = Builder.CreateAnd(IVal, ExpBitMask);
+  Value *B1 = Builder.CreateICmpEQ(Exp, ExpBitMask);
+
+  Value *Sig = Builder.CreateAnd(IVal, SigBitMask);
+  Value *B2 = Builder.CreateICmpNE(Sig, Zero);
+  Value *B3 = Builder.CreateAnd(B1, B2);
+  return B3;
+}
+
+static Value *expand16BitIsFinite(CallInst *Orig) {
+  Module *M = Orig->getModule();
+  if (M->getTargetTriple().getDXILVersion() >= VersionTuple(1, 9))
+    return nullptr;
+
+  Value *Val = Orig->getOperand(0);
+  Type *ValTy = Val->getType();
+  if (!ValTy->getScalarType()->isHalfTy())
+    return nullptr;
+
+  IRBuilder<> Builder(Orig);
+  Type *IType = Type::getInt16Ty(M->getContext());
+
+  Constant *ExpBitMask =
+      ValTy->isVectorTy()
+          ? ConstantVector::getSplat(
+                ElementCount::getFixed(
+                    cast<FixedVectorType>(ValTy)->getNumElements()),
+                ConstantInt::get(IType, 0x7c00))
+          : ConstantInt::get(IType, 0x7c00);
+
+  Value *IVal = Builder.CreateBitCast(Val, ExpBitMask->getType());
+  Value *Exp = Builder.CreateAnd(IVal, ExpBitMask);
+  Value *B1 = Builder.CreateICmpNE(Exp, ExpBitMask);
+  return B1;
+}
+
+static Value *expand16BitIsNormal(CallInst *Orig) {
+  Module *M = Orig->getModule();
+  if (M->getTargetTriple().getDXILVersion() >= VersionTuple(1, 9))
+    return nullptr;
+
+  Value *Val = Orig->getOperand(0);
+  Type *ValTy = Val->getType();
+  if (!ValTy->getScalarType()->isHalfTy())
+    return nullptr;
+
+  IRBuilder<> Builder(Orig);
+  Type *IType = Type::getInt16Ty(M->getContext());
+
+  Constant *ExpBitMask =
+      ValTy->isVectorTy()
+          ? ConstantVector::getSplat(
+                ElementCount::getFixed(
+                    cast<FixedVectorType>(ValTy)->getNumElements()),
+                ConstantInt::get(IType, 0x7c00))
+          : ConstantInt::get(IType, 0x7c00);
+  Constant *Zero =
+      ValTy->isVectorTy()
+          ? ConstantVector::getSplat(
+                ElementCount::getFixed(
+                    cast<FixedVectorType>(ValTy)->getNumElements()),
+                ConstantInt::get(IType, 0))
+          : ConstantInt::get(IType, 0);
+
+  Value *IVal = Builder.CreateBitCast(Val, ExpBitMask->getType());
+  Value *Exp = Builder.CreateAnd(IVal, ExpBitMask);
+  Value *NotAllZeroes = Builder.CreateICmpNE(Exp, Zero);
+  Value *NotAllOnes = Builder.CreateICmpNE(Exp, ExpBitMask);
+  Value *B1 = Builder.CreateAnd(NotAllZeroes, NotAllOnes);
+  return B1;
+}
+
 static bool isIntrinsicExpansion(Function &F) {
   switch (F.getIntrinsicID()) {
   case Intrinsic::abs:
@@ -342,8 +451,11 @@ static Value *expandIsFPClass(CallInst *Orig) {
   case FPClassTest::fcInf:
     return expand16BitIsInf(Orig);
   case FPClassTest::fcNan:
+    return expand16BitIsNaN(Orig);
   case FPClassTest::fcNormal:
+    return expand16BitIsNormal(Orig);
   case FPClassTest::fcFinite:
+    return expand16BitIsFinite(Orig);
     return nullptr;
   }
 
diff --git a/llvm/test/CodeGen/DirectX/is_fpclass.ll b/llvm/test/CodeGen/DirectX/is_fpclass.ll
index 1796e8bd794d8..f5804f3418853 100644
--- a/llvm/test/CodeGen/DirectX/is_fpclass.ll
+++ b/llvm/test/CodeGen/DirectX/is_fpclass.ll
@@ -46,6 +46,25 @@ entry:
   ret i1 %0
 }
 
+define noundef i1 @isnanh(half noundef %a) {
+; CHECK-LABEL: define noundef i1 @isnanh(
+; CHECK-SAME: half noundef [[A:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; SM69CHECK-NEXT:  [[TMP0:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 8, half [[A]]) #[[ATTR0:[0-9]+]]
+; SMOLDCHECK-NEXT: [[BITCAST:%.*]] = bitcast half [[A]] to i16
+; SMOLDCHECK-NEXT: [[AND:%.*]] = and i16 [[BITCAST]], 31744
+; SMOLDCHECK-NEXT: [[CMPHIGH:%.*]] = icmp eq i16 [[AND]], 31744
+; SMOLDCHECK-NEXT: [[ANDLOW:%.*]] = and i16 [[BITCAST]], 1023
+; SMOLDCHECK-NEXT: [[CMPZERO:%.*]] = icmp ne i16 [[ANDLOW]], 0
+; SMOLDCHECK-NEXT: [[ANDLOW:%.*]] = and i1 [[CMPHIGH]], [[CMPZERO]]
+; SMOLDCHECK-NEXT: ret i1 [[ANDLOW]]
+; SM69CHECK-NEXT:  ret i1 [[TMP0]]
+;
+entry:
+  %0 = call i1 @llvm.is.fpclass.f16(half %a, i32 3)
+  ret i1 %0
+}
+
 define noundef <2 x i1> @isnanv2(<2 x float> noundef %a) {
 ; CHECK-LABEL: define noundef <2 x i1> @isnanv2(
 ; CHECK-SAME: <2 x float> noundef [[A:%.*]]) {
@@ -63,6 +82,40 @@ entry:
   ret <2 x i1> %0
 }
 
+define noundef <2 x i1> @isnanhv2(<2 x half> noundef %a) {
+; CHECK-LABEL: define noundef <2 x i1> @isnanhv2(
+; CHECK-SAME: <2 x half> noundef [[A:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[A_I0:%.*]] = extractelement <2 x half> [[A]], i64 0
+; SM69CHECK-NEXT:    [[DOTI02:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 8, half [[A_I0]]) #[[ATTR0:[0-9]+]]
+; SM69CHECK-NEXT:    [[A_I1:%.*]] = extractelement <2 x half> [[A]], i64 1
+; SM69CHECK-NEXT:    [[DOTI11:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 8, half [[A_I1]]) #[[ATTR0]]
+; SM69CHECK-NEXT:    [[DOTUPTO0:%.*]] = insertelement <2 x i1> poison, i1 [[DOTI02]], i64 0
+; SM69CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i1> [[DOTUPTO0]], i1 [[DOTI11]], i64 1
+; SM69CHECK-NEXT:    ret <2 x i1> [[TMP0]]
+;
+; SMOLDCHECK-NEXT:    [[DOTI0:%.*]] = bitcast half [[A_I0]] to i16
+; SMOLDCHECK-NEXT:    [[A_I1:%.*]] = extractelement <2 x half> [[A]], i64 1
+; SMOLDCHECK-NEXT:    [[DOTI1:%.*]] = bitcast half [[A_I1]] to i16
+; SMOLDCHECK-NEXT:    [[DOTI01:%.*]] = and i16 [[DOTI0]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI12:%.*]] = and i16 [[DOTI1]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI03:%.*]] = icmp eq i16 [[DOTI01]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI14:%.*]] = icmp eq i16 [[DOTI12]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI05:%.*]] = and i16 [[DOTI0]], 1023
+; SMOLDCHECK-NEXT:    [[DOTI16:%.*]] = and i16 [[DOTI1]], 1023
+; SMOLDCHECK-NEXT:    [[DOTI07:%.*]] = icmp ne i16 [[DOTI05]], 0
+; SMOLDCHECK-NEXT:    [[DOTI18:%.*]] = icmp ne i16 [[DOTI16]], 0
+; SMOLDCHECK-NEXT:    [[DOTI09:%.*]] = and i1 [[DOTI03]], [[DOTI07]]
+; SMOLDCHECK-NEXT:    [[DOTI110:%.*]] = and i1 [[DOTI14]], [[DOTI18]]
+; SMOLDCHECK-NEXT:    [[DOTUPTO015:%.*]] = insertelement <2 x i1> poison, i1 [[DOTI09]], i64 0
+; SMOLDCHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i1> [[DOTUPTO015]], i1 [[DOTI110]], i64 1
+; SMOLDCHECK-NEXT:    ret <2 x i1> [[TMP0]]
+;
+entry:
+  %0 = call <2 x i1> @llvm.is.fpclass.v2f16(<2 x half> %a, i32 3)
+  ret <2 x i1> %0
+}
+
 define noundef i1 @isinf(float noundef %a) {
 ; CHECK-LABEL: define noundef i1 @isinf(
 ; CHECK-SAME: float noundef [[A:%.*]]) {
@@ -80,7 +133,7 @@ define noundef i1 @isinfh(half noundef %a) {
 ; CHECK-SAME: half noundef [[A:%.*]]) {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
 ; SM69CHECK-NEXT:    [[ISINF:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 9, half [[A]]) #[[ATTR0]]
-; SMOLDCHECK-NEXT: [[BITCAST:%.*]] = bitcast half %a to i16
+; SMOLDCHECK-NEXT: [[BITCAST:%.*]] = bitcast half [[A]] to i16
 ; SMOLDCHECK-NEXT: [[CMPHIGH:%.*]] = icmp eq i16 [[BITCAST]], 31744
 ; SMOLDCHECK-NEXT: [[CMPLOW:%.*]] = icmp eq i16 [[BITCAST]], -1024
 ; SMOLDCHECK-NEXT: [[OR:%.*]] = or i1 [[CMPHIGH]], [[CMPLOW]]
@@ -121,6 +174,22 @@ entry:
   ret i1 %0
 }
 
+define noundef i1 @isfiniteh(half noundef %a) {
+; CHECK-LABEL: define noundef i1 @isfiniteh(
+; CHECK-SAME: half noundef [[A:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; SM69CHECK-NEXT:  [[TMP0:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 10, half [[A]]) #[[ATTR0]]
+; SMOLDCHECK-NEXT: [[BITCAST:%.*]] = bitcast half [[A]] to i16
+; SMOLDCHECK-NEXT: [[AND:%.*]] = and i16 [[BITCAST]], 31744
+; SMOLDCHECK-NEXT: [[CMPHIGH:%.*]] = icmp ne i16 [[AND]], 31744
+; SMOLDCHECK-NEXT: ret i1 [[CMPHIGH]]
+; SM69CHECK-NEXT:  ret i1 [[TMP0]]
+;
+entry:
+  %0 = call i1 @llvm.is.fpclass.f16(half %a, i32 504)
+  ret i1 %0
+}
+
 define noundef <2 x i1> @isfinitev2(<2 x float> noundef %a) {
 ; CHECK-LABEL: define noundef <2 x i1> @isfinitev2(
 ; CHECK-SAME: <2 x float> noundef [[A:%.*]]) {
@@ -138,6 +207,35 @@ entry:
   ret <2 x i1> %0
 }
 
+define noundef <2 x i1> @isfinitehv2(<2 x half> noundef %a) {
+; CHECK-LABEL: define noundef <2 x i1> @isfinitehv2(
+; CHECK-SAME: <2 x half> noundef [[A:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; SM69CHECK-NEXT:    [[A_I0:%.*]] = extractelement <2 x half> [[A]], i64 0
+; SM69CHECK-NEXT:    [[DOTI02:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 10, half [[A_I0]]) #[[ATTR0:[0-9]+]]
+; SM69CHECK-NEXT:    [[A_I1:%.*]] = extractelement <2 x half> [[A]], i64 1
+; SM69CHECK-NEXT:    [[DOTI11:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 10, half [[A_I1]]) #[[ATTR0]]
+; SM69CHECK-NEXT:    [[DOTUPTO0:%.*]] = insertelement <2 x i1> poison, i1 [[DOTI02]], i64 0
+; SM69CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i1> [[DOTUPTO0]], i1 [[DOTI11]], i64 1
+; SM69CHECK-NEXT:    ret <2 x i1> [[TMP0]]
+;
+; SMOLDCHECK-NEXT:    [[A_I0:%.*]] = extractelement <2 x half> [[A]], i64 0
+; SMOLDCHECK-NEXT:    [[DOTI0:%.*]] = bitcast half [[A_I0]] to i16
+; SMOLDCHECK-NEXT:    [[A_I1:%.*]] = extractelement <2 x half> [[A]], i64 1
+; SMOLDCHECK-NEXT:    [[DOTI1:%.*]] = bitcast half [[A_I1]] to i16
+; SMOLDCHECK-NEXT:    [[DOTI01:%.*]] = and i16 [[DOTI0]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI12:%.*]] = and i16 [[DOTI1]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI03:%.*]] = icmp ne i16 [[DOTI01]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI14:%.*]] = icmp ne i16 [[DOTI12]], 31744
+; SMOLDCHECK-NEXT:    [[DOTUPTO06:%.*]] = insertelement <2 x i1> poison, i1 [[DOTI03]], i64 0
+; SMOLDCHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i1> [[DOTUPTO06]], i1 [[DOTI14]], i64 1
+; SMOLDCHECK-NEXT:    ret <2 x i1> [[TMP0]]
+;
+entry:
+  %0 = call <2 x i1> @llvm.is.fpclass.v2f16(<2 x half> %a, i32 504)
+  ret <2 x i1> %0
+}
+
 define noundef i1 @isnormal(float noundef %a) {
 ; CHECK-LABEL: define noundef i1 @isnormal(
 ; CHECK-SAME: float noundef [[A:%.*]]) {
@@ -150,6 +248,24 @@ entry:
   ret i1 %0
 }
 
+define noundef i1 @isnormalh(half noundef %a) {
+; CHECK-LABEL: define noundef i1 @isnormalh(
+; CHECK-SAME: half noundef [[A:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; SM69CHECK-NEXT:  [[TMP0:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 11, half [[A]]) #[[ATTR0]]
+; SMOLDCHECK-NEXT: [[BITCAST:%.*]] = bitcast half [[A]] to i16
+; SMOLDCHECK-NEXT: [[AND:%.*]] = and i16 [[BITCAST]], 31744
+; SMOLDCHECK-NEXT: [[CMPZERO:%.*]] = icmp ne i16 [[AND]], 0
+; SMOLDCHECK-NEXT: [[CMPHIGH:%.*]] = icmp ne i16 [[AND]], 31744
+; SMOLDCHECK-NEXT: [[ANDCMP:%.*]] = and i1 [[CMPZERO]], [[CMPHIGH]]
+; SMOLDCHECK-NEXT: ret i1 [[ANDCMP]]
+; SM69CHECK-NEXT:  ret i1 [[TMP0]]
+;
+entry:
+  %0 = call i1 @llvm.is.fpclass.f16(half %a, i32 264)
+  ret i1 %0
+}
+
 define noundef <2 x i1> @isnormalv2(<2 x float> noundef %a) {
 ; CHECK-LABEL: define noundef <2 x i1> @isnormalv2(
 ; CHECK-SAME: <2 x float> noundef [[A:%.*]]) {
@@ -167,5 +283,37 @@ entry:
   ret <2 x i1> %0
 }
 
+define noundef <2 x i1> @isnormalhv2(<2 x half> noundef %a) {
+; CHECK-LABEL: define noundef <2 x i1> @isnormalhv2(
+; CHECK-SAME: <2 x half> noundef [[A:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[A_I0:%.*]] = extractelement <2 x half> [[A]], i64 0
+; SM69CHECK-NEXT:    [[DOTI02:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 11, half [[A_I0]]) #[[ATTR0:[0-9]+]]
+; SM69CHECK-NEXT:    [[A_I1:%.*]] = extractelement <2 x half> [[A]], i64 1
+; SM69CHECK-NEXT:    [[DOTI11:%.*]] = call i1 @dx.op.isSpecialFloat.f16(i32 11, half [[A_I1]]) #[[ATTR0]]
+; SM69CHECK-NEXT:    [[DOTUPTO0:%.*]] = insertelement <2 x i1> poison, i1 [[DOTI02]], i64 0
+; SM69CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i1> [[DOTUPTO0]], i1 [[DOTI11]], i64 1
+; SM69CHECK-NEXT:    ret <2 x i1> [[TMP0]]
+;
+; SMOLDCHECK-NEXT:    [[DOTI0:%.*]] = bitcast half [[A_I0]] to i16
+; SMOLDCHECK-NEXT:    [[A_I1:%.*]] = extractelement <2 x half> [[A]], i64 1
+; SMOLDCHECK-NEXT:    [[DOTI1:%.*]] = bitcast half [[A_I1]] to i16
+; SMOLDCHECK-NEXT:    [[DOTI01:%.*]] = and i16 [[DOTI0]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI12:%.*]] = and i16 [[DOTI1]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI03:%.*]] = icmp ne i16 [[DOTI01]], 0
+; SMOLDCHECK-NEXT:    [[DOTI14:%.*]] = icmp ne i16 [[DOTI12]], 0
+; SMOLDCHECK-NEXT:    [[DOTI05:%.*]] = icmp ne i16 [[DOTI01]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI16:%.*]] = icmp ne i16 [[DOTI12]], 31744
+; SMOLDCHECK-NEXT:    [[DOTI07:%.*]] = and i1 [[DOTI03]], [[DOTI05]]
+; SMOLDCHECK-NEXT:    [[DOTI18:%.*]] = and i1 [[DOTI14]], [[DOTI16]]
+; SMOLDCHECK-NEXT:    [[DOTUPTO012:%.*]] = insertelement <2 x i1> poison, i1 [[DOTI07]], i64 0
+; SMOLDCHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x i1> [[DOTUPTO012]], i1 [[DOTI18]], i64 1
+; SMOLDCHECK-NEXT:    ret <2 x i1> [[TMP0]]
+;
+entry:
+  %0 = call <2 x i1> @llvm.is.fpclass.v2f16(<2 x half> %a, i32 264)
+  ret <2 x i1> %0
+}
+
 declare i1 @llvm.is.fpclass.f32(float, i32 immarg)
 declare <2 x i1> @llvm.is.fpclass.v2f32(<2 x float>, i32 immarg)

Copy link
Contributor

@spall spall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@farzonl
Copy link
Member Author

farzonl commented Sep 8, 2025

failed tests are not related

lldb-api :: functionalities/asan/TestMemoryHistory.py
 lldb-api :: functionalities/asan/TestReportData.py

@farzonl farzonl merged commit 1dbade8 into llvm:main Sep 8, 2025
9 of 10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 8, 2025

LLVM Buildbot has detected a new failure on builder ppc64le-flang-rhel-clang running on ppc64le-flang-rhel-test while building llvm at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/39245

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/OpenMP/DelayedPrivatization/target-private-implicit-scalar-map-2.f90' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 4
split-file /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/test/Lower/OpenMP/DelayedPrivatization/target-private-implicit-scalar-map-2.f90 /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp
# executed command: split-file /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/test/Lower/OpenMP/DelayedPrivatization/target-private-implicit-scalar-map-2.f90 /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp
# RUN: at line 6
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/flang -fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging -fopenmp-version=50 /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_module.f90 -o -  | /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/flang -fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging  -fopenmp-version=50 /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90 -o -  | /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/flang -fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging -fopenmp-version=50 /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_module.f90 -o -
# .---command stdout------------
# | module attributes {dlti.dl_spec = #dlti.dl_spec<i64 = dense<64> : vector<2xi64>, i128 = dense<128> : vector<2xi64>, !llvm.ptr = dense<64> : vector<4xi64>, i1 = dense<8> : vector<2xi64>, i8 = dense<8> : vector<2xi64>, i16 = dense<16> : vector<2xi64>, i32 = dense<32> : vector<2xi64>, f16 = dense<16> : vector<2xi64>, f64 = dense<64> : vector<2xi64>, f128 = dense<128> : vector<2xi64>, "dlti.endianness" = "little", "dlti.mangling_mode" = "e", "dlti.function_pointer_alignment" = #dlti.function_pointer_alignment<32, function_dependent = true>, "dlti.legal_int_widths" = array<i32: 32, 64>, "dlti.stack_alignment" = 128 : i64>, fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", fir.target_features = #llvm.target_features<["+64bit"]>, llvm.data_layout = "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512", llvm.ident = "flang version 22.0.0 (https://github.com/llvm/llvm-project.git 1dbade85cb3500f11cb8cefd0541efebbb0a8fda)", llvm.target_triple = "powerpc64le-unknown-linux-gnu", omp.is_gpu = false, omp.is_target_device = false, omp.target_triples = [], omp.version = #omp.version<version = 50>} {
# |   fir.global @_QMtest_dataEj : !fir.array<200xi8> {
# |     %0 = fir.zero_bits !fir.array<200xi8>
# |     fir.has_value %0 : !fir.array<200xi8>
# |   }
# |   fir.global @_QMtest_dataEi : !fir.array<10x10xf32> {
# |     %0 = fir.zero_bits !fir.array<10x10xf32>
# |     fir.has_value %0 : !fir.array<10x10xf32>
# |   }
# |   fir.global @_QMtest_dataEz : i32 {
# |     %0 = fir.zero_bits i32
# |     fir.has_value %0 : i32
# |   }
# | }
# `-----------------------------
# .---command stderr------------
# | warning: OpenMP support for version 50 in flang is still incomplete
# `-----------------------------
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/bin/flang -fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging -fopenmp-version=50 /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90 -o -
# .---command stderr------------
# | warning: OpenMP support for version 50 in flang is still incomplete
# | error: Semantic errors in /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90
# | /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90:2:9: error: Cannot parse module file for module 'test_data': Source file 'test_data.mod' was not found
# |       use test_data
# |           ^^^^^^^^^
# | /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90:7:17: error: No explicit type declared for 'z'
# |           x = y + z + i(1,1) + j(1,1,1) + k(1,1)
# |                   ^
# | /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90:7:21: error: No explicit type declared for 'i'
# |           x = y + z + i(1,1) + j(1,1,1) + k(1,1)
# |                       ^
# | /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90:7:30: error: No explicit type declared for 'j'
# |           x = y + z + i(1,1) + j(1,1,1) + k(1,1)
# |                                ^
# | /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/test/Lower/OpenMP/DelayedPrivatization/Output/target-private-implicit-scalar-map-2.f90.tmp/imp_scalar_map_target.f90:7:41: error: No explicit type declared for 'k'
# |           x = y + z + i(1,1) + j(1,1,1) + k(1,1)
# |                                           ^
# `-----------------------------
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Directx] Support emulation for all fp16 types of llvm.is.fpclass IsNaN, IsFinite, & IsNormal

5 participants